package com.sxjh.controller.figureReport;

import com.alibaba.fastjson.JSONObject;
import com.sxjh.common.Result;
import com.sxjh.entity.ComprehensiveReport;
import com.sxjh.entity.param.ComprehensiveReportParam;
import com.sxjh.service.figureReport.ComprehensiveReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/comprehensiveReport")
@Api(tags = "综合统计报表/用于饼状图")
public class ComprehensiveReportController {

    @Autowired
    private ComprehensiveReportService comprehensiveReportService;

    /*甲醇销售*/
    @ApiOperation("甲醇销售对账产品")
    @GetMapping("/getReportData")
    Result<List<JSONObject>> getReportData(@Validated ComprehensiveReportParam param) {
        return Result.ok(comprehensiveReportService.queryReportDataByDay(param));
    }

    /*甲醇销售*/
    @ApiOperation("甲醇销售对账产品")
    @GetMapping("/getReportData2")
    Result<List<ComprehensiveReport>> getReportData2(@Validated ComprehensiveReportParam param) {
        return Result.ok(comprehensiveReportService.queryReportDataByDay2(param));
    }

}
